package com.example.myapplication;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import java.util.List;

public class Liebiao extends RecyclerView.Adapter<Liebiao.Hert> {

    List<LiebieoaJiekou.Data.list>liebieoaJiekous;

    public Liebiao(List<LiebieoaJiekou.Data.list> liebieoaJiekous) {
        this.liebieoaJiekous = liebieoaJiekous;
    }

    @NonNull
    @Override
    public Hert onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View lain = LayoutInflater.from(parent.getContext()).inflate(R.layout.rec,parent,false);
        return new Hert(lain);
    }

    @Override
    public void onBindViewHolder(@NonNull Hert holder, int position) {

        new util().setWebImage("https://photo.vshare.site"+this.liebieoaJiekous.get(position).getImage(),holder.imageView6);
        holder.textView10.setText(liebieoaJiekous.get(position).getAuthor());
        }

    @Override
    public int getItemCount() {
        return this.liebieoaJiekous.size();
    }

    public class Hert extends RecyclerView.ViewHolder {

        ImageView imageView6;
        TextView textView11;
        TextView textView8;
        TextView textView9;
        TextView textView10;
        TextView textView12;
        public Hert(@NonNull View itemView) {
            super(itemView);
            imageView6=itemView.findViewById(R.id.imageView6);
            textView11=itemView.findViewById(R.id.textView11);
            textView8=itemView.findViewById(R.id.textView8);
            textView9=itemView.findViewById(R.id.textView9);
            textView10=itemView.findViewById(R.id.textView10);
            textView12=itemView.findViewById(R.id.textView12);
        }
    }
}
